import { createRouter, createWebHistory } from 'vue-router'

import video from '@/views/video/index.vue'
import err404 from '@/views/err/404.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/:pyid/playe/',
      name: 'video',
      component: video
    },
    {
      path: '/404',
      name: '404',
      component: err404
    },
    // 当什么都没有匹配到的时候，重定向页面到 404 页面
    { path: "/:pathMatch(.*)", redirect: "/404", name: "notMatch", hidden: true },
  ]
})

export default router
